//
//  OASocketMethed.h
//  LongOA
//
//  Created by 耿用强 on 15/7/5.
//  Copyright (c) 2015年 耿用强. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AsyncSocket.h"
typedef enum _SocketOffline{
    SocketOfflineByServer =0,// 服务器掉线，默认为0
    SocketOfflineByUser  =1,  // 用户主动cut
    SocketOfflineByIpError
}SocketOffline;
@interface OASocketMethed : NSObject<AsyncSocketDelegate>
typedef void(^CompletionLoadHandle)(NSData *posts, NSError *error);
@property (nonatomic,strong) AsyncSocket *clientSocket;

@property (nonatomic,assign) SocketOffline offType;
@property (nonatomic,copy)CompletionLoadHandle completBolck;
@property (nonatomic,strong)NSData*sendData;
+ (OASocketMethed*)sharedOASocketMethed;

- (void)writeData:(NSData*)data andTag:(int)tag back:(CompletionLoadHandle)block;


@end
